<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@ include file="/pub/headmeta.jsp" %>
<link rel="stylesheet" type="text/css" href="${ctx}/login.css"/>
<script type="text/javascript">
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
</script>
</head>

<body onload="MM_preloadImages('images/login/land-l.png')">
	  <div id="layout">
			<div class="index-1">
				<form id="loginForm" method="post">
				<div style="padding: 0px; border: 0px solid rgb(0, 157, 225); height: 70px; text-align: left; margin-top: 3px;">				
			      <span class="login-font">账&nbsp;&nbsp;号</span>
                  <span class="login-input"><input type='text' name="account" id="account" class="index-2" value="admin"/></span><br/>
                  <span class="login-font1">密&nbsp;&nbsp;码</span>
                  <span class="login-input1"><input type='text' name="pwd" id="pwd" class="index-3" value="123456"/><br/></span>
                  <a href="javascript:doLogin();" style="cursor:pointer;" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image1','','images/login/land-l.png',1)"><img class="login-image" src="images/login/land-m.png" name="Image1" width="306" height="51" border="0" id="Image1" /></a>
                 </div>
                 </form>
			</div>
            <div style="clear:both;"></div><font class="font-pe"> Copyright 2012 All Rights Reserved 中国移动珠海分公司版权所有</font>
	  </div>
</body>
</html>
<script type="text/javascript">
<!--
	//登录
	function doLogin() {
		if ($("#account").val()== ""){
			alert('帐号不能为空！');
			return;
		}
		if ($("#pwd").val() == ""){
			alert('密码不能为空！');
			return;
		}
		if ($("#pwd").val().length<6){
			alert('密码长度至少6位！');
			return;
		}		

		var url="${ctx}/sys!login.action";
		$.post(url, $("#loginForm").serialize() ,function callback(txt){   
				var json = $.parseJSON(txt);   
				if (json.code==0) {					
					location.href="${ctx}/sys!goFramePage.action";					
				}else{
					alert('登录失败！请检查帐号或密码！');
				}
		}); 
	}
	//密码找回
	function findBackPwd(){
		if ($("#account").val()== ""){
			alert('请输入要找回密码的帐号！');
			return;
		}
		var url="${ctx}/user!findPwd.action";
		$.post(url, $("#loginForm").serialize() ,function callback(txt){   
			var json = $.parseJSON(txt);   
			if (json.code==0) {					
				alert('密码重置链接已经发送到您的注册邮箱！(有效时间1小时)');					
			}else{
				alert('找回密码失败！原因：\r\n1-帐号不存在\r\n2-帐号无关联电子邮箱');
			}
		});
	}
//-->
</script>
